package com.mr.outputformat;

import java.io.IOException;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

/*
 * 1.什么时候需要reduce
 * 		①合并
 * 		②需要对数据排序
 *
 * 2.没有Reduce阶段，key-value不需要实现序列化（不需要传输）
 */

public class OutputFormatMapper extends Mapper<LongWritable, Text, String, NullWritable>{

	@Override
	protected void map(LongWritable key, Text value, Mapper<LongWritable, Text, String, NullWritable>.Context context)
			throws IOException, InterruptedException {


		context.write(value.toString() + "\r\n", NullWritable.get());
	}

}
